home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Snippets / Development Tools & Languages / DTSCPlusLibrary / Sources / GUIApplication.r < prev    next >
Encoding:
Text File  |  1993-01-14  |  5.1 KB  |  203 lines  |  [TEXT/MPS ]

  1. /* _________________________________________________________________________________________________________ //
  2.   Copyright © 1992-93 Apple Computer, Inc. All rights reserved.
  3.   Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
  4.   Date: 11/15/92
  5.   Revision comments are at the end of this file.
  6.   ---
  7.   Application is a simple application environment.
  8.   GUIApplication contains the default window oriented application resources.
  9.   Rez -rd -o TargetApplication GUIApplication.r -append
  10.   _________________________________________________________________________________________________________ */
  11.  
  12. // INCLUDES
  13. #include "SysTypes.r"
  14. #include "Types.r"
  15. #include "ApplicationResources.h"
  16.  
  17.  
  18. // _________________________________________________________________________________________________________ //
  19. // MEMORY
  20.  
  21. #define kPrefSize    314                // k of memory preferred
  22. #define kMinSize     314                // k of memory minimally  
  23.  
  24.  
  25.  
  26. // _________________________________________________________________________________________________________ //
  27. // MENU HANDLING (MBAR, MENU)
  28.  
  29. // MBAR: If you have more menu entries, add these in after the default ones
  30. resource 'MBAR' (mAppMBAR, preload) {
  31.     { mApple, mFile };
  32. };
  33.  
  34.  
  35. // MENU RESOURCES
  36.  
  37. resource 'MENU' (mApple, preload) {
  38.     mApple, textMenuProc,
  39.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  40.     enabled, apple,
  41.     {
  42.         "About Application…",
  43.             noicon, nokey, nomark, plain;
  44.         "-",
  45.             noicon, nokey, nomark, plain
  46.     }
  47. };
  48.  
  49.  
  50.  
  51. resource 'MENU' (mFile, preload) {
  52.     mFile, textMenuProc,
  53.     0b0000000000000000000100000000000,    /* enable Quit only, program enables others */
  54.     enabled, "File",
  55.     {
  56.         "New",
  57.             noicon, "N", nomark, plain;
  58.         "Open",
  59.             noicon, "O", nomark, plain;
  60.         "-",
  61.             noicon, nokey, nomark, plain;
  62.         "Close",
  63.             noicon, "W", nomark, plain;
  64.         "Save",
  65.             noicon, "S", nomark, plain;
  66.         "Save As…",
  67.             noicon, nokey, nomark, plain;
  68.         "Revert",
  69.             noicon, nokey, nomark, plain;
  70.         "-",
  71.             noicon, nokey, nomark, plain;
  72.         "Page Setup…",
  73.             noicon, nokey, nomark, plain;
  74.         "Print…",
  75.             noicon, nokey, nomark, plain;
  76.         "-",
  77.             noicon, nokey, nomark, plain;
  78.         "Quit",
  79.             noicon, "Q", nomark, plain
  80.     }
  81. };
  82.  
  83.  
  84. // _________________________________________________________________________________________________________ //
  85. // APPLE EVENT SUPPORT
  86.  
  87. // Our AE resource for dispatching based on event class and id 
  88. type 'aedt' {
  89.     wide array {
  90.     unsigned longint;    // Event Class
  91.     unsigned longint;    // Event ID
  92.     unsigned longint;    // Command Number
  93.     };
  94. };
  95.  
  96.  
  97.  
  98. resource 'aedt' (kCoreAEDispatchTable) {{            // Minimum for AppleEvent aware application
  99.     'aevt', 'ansr', cAppleEventReply;
  100.     'aevt', 'oapp', cNewCommand;
  101.     'aevt', 'odoc', cOpenCommand;
  102.     'aevt', 'quit', cQuitCommand;
  103.     'aevt', 'pdoc', cPrintCommand;
  104.     }
  105. };
  106.  
  107. resource 'aedt' (kGUIAEDispatchTable) {{            // Basic GUI AE framework support
  108.     'aevt', 'abou', cAboutCommand;
  109.     }
  110. };
  111.  
  112.  
  113. // _________________________________________________________________________________________________________ //
  114. // USER INTERACTION MODULES (Alerts, Dialog boxes…)
  115.  
  116. /* this ALRT and DITL are used as an ASSERT error screen */
  117.  
  118.  
  119. resource 'ALRT' (kUserAlert, purgeable) {
  120.     {40, 20, 189, 468},
  121.     100,
  122.     {    /* array: 4 elements */
  123.         /* [1] */
  124.         OK, visible, silent,
  125.         /* [2] */
  126.         OK, visible, silent,
  127.         /* [3] */
  128.         OK, visible, silent,
  129.         /* [4] */
  130.         OK, visible, silent
  131.     }
  132. };
  133.  
  134. resource 'DITL' (kUserAlert, purgeable) {
  135.     {    /* array DITLarray: 3 elements */
  136.         /* [1] */
  137.         {122, 360, 142, 440},
  138.         Button {
  139.             enabled,
  140.             "OK"
  141.         },
  142.         /* [2] */
  143.         {9, 48, 115, 439},
  144.         StaticText {
  145.             disabled,
  146.             "Error: ^0."
  147.         },
  148.         /* [3] */
  149.         {8, 8, 40, 40},
  150.         Icon {
  151.             disabled,
  152.             2
  153.         }
  154.     }
  155. };
  156.  
  157.  
  158. // _________________________________________________________________________________________________________ //
  159. // VERS RESOURCES
  160.  
  161. resource 'vers' (1) {
  162.     0x01, 0x00, release, 0x00,
  163.     verUS,
  164.     "1.00",
  165.     "1.00, Copyright © 1993 Apple Computer, Inc."
  166. };
  167.  
  168. // SIZE -----------------------------------------------------------------------------------
  169.  
  170. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  171.  
  172. resource 'SIZE' (-1) {
  173.     dontSaveScreen,
  174.     acceptSuspendResumeEvents,
  175.     enableOptionSwitch,
  176.     canBackground,                // we can background; we don't currently, but our sleep value
  177.                                 // guarantees we don't hog the Mac while we are in the background
  178.     doesActivateOnFGSwitch,        // this says we do our own activate/deactivate; don't fake us out
  179.     backgroundAndForeground,    // this is definitely not a background-only application!
  180.     dontGetFrontClicks,            // change this is if you want "do first click" behavior like the Finder
  181.     ignoreAppDiedEvents,        // essentially, I'm not a debugger (sub-launching)
  182.     is32BitCompatible,            // this app works OK in 32-bit address space
  183.     isHighLevelEventAware,        // Apple Events support
  184.     localAndRemoteHLEvents,        // Apple Events support
  185.     reserved,
  186.     reserved,
  187.     reserved,
  188.     reserved,
  189.     reserved,
  190.     kPrefSize * 1024,
  191.     kMinSize * 1024    
  192. };
  193.  
  194.  
  195. // _________________________________________________________________________________________________________ //
  196.  
  197.  
  198. /*    Change History (most recent last):
  199.   No        Init.    Date        Comment
  200.   1            khs        11/15/92    New file
  201.   2            khs        1/14/93        Cleanup
  202. */
  203.